$(function () {
    page();
})

function page() {
    let id = localStorage.getItem("WZYDfileID");
    $.post("/Mmanufacture.do/DfileXQWZY", {id:id }, function (sdata) {
        let str = " <tr class=\"btn-info\">\n" +
            "                <td colspan=\"4\" style=\"font-weight: 900\" class=\"text-left\">主信息</td>\n" +
            "            </tr>\n" +
            "            <tr>\n" +
            "                <th class=\"text-right\">档案编号:</th>\n" +
            "                <td colspan=\"3\" class=\"text-left\">" + sdata.productid + "</td>\n" +
            "            </tr>\n" +
            "            <tr>\n" +
            "                <th class=\"text-right\">产品名称：</th>\n" +
            "                <td>" + sdata.productname + "</td>\n" +
            "                <th class=\"text-right\">制造商：</th>\n" +
            "                <td>" + sdata.factoryname + "</td>\n" +
            "            </tr>\n" +
            "            <tr>\n" +
            "                <th class=\"text-right\">I 级分类：</th>\n" +
            "                <td>" + sdata.firstkindname + "</td>\n" +
            "                <th class=\"text-right\">II 级分类：</th>\n" +
            "                <td>" + sdata.secondkindname + "</td>\n" +
            "            </tr>\n" +
            "            <tr>\n" +
            "                <th class=\"text-right\">III 级分类：</th>\n" +
            "                <td>" + sdata.thirdkindname + "</td>\n" +
            "                <th class=\"text-right\">产品简称：</th>\n" +
            "                <td>" + sdata.productnick + "</td>\n" +
            "            </tr>\n" +
            "            <tr>\n" +
            "                <th class=\"text-right\">用途类型：</th>\n" +
            "                <td>" + (sdata.type == 'Y001-1' ? '商品' : sdata.type == 'Y001-2' ? '物料' : '') + "</td>\n" +
            "                <th class=\"text-right\">档次级别：</th>\n" +
            "                <td>" + (sdata.productclass == 'D001-1' ? '高档' :
                                  sdata.productclass == 'D001-2' ? '中档' :
                                 sdata.productclass == 'D001-3' ? '低档' : '') + "</td>\n" +
            "            </tr>\n" +
            "            <tr>\n" +
            "                <th class=\"text-right\">计量单位：</th>\n" +
            "                <td>" + sdata.personalunit + "</td>\n" +
            "                <th class=\"text-right\">计量值：</th>\n" +
            "                <td>" + sdata.personalvalue + "</td>\n" +
            "            </tr>\n" +
            "            <tr>\n" +
            "                <th class=\"text-right\">市场单价(元)：</th>\n" +
            "                <td>" + sdata.listprice + "</td>\n" +
            "                <th class=\"text-right\">成本单价（元）</th>\n" +
            "                <td>" + sdata.costprice + "</td>\n" +
            "            </tr>\n" +
            "            <tr class=\"btn-info\">\n" +
            "                <td colspan=\"4\" style=\"font-weight: 900\" class=\"text-left\">辅助信息</td>\n" +
            "            </tr>\n" +
            "            <tr>\n" +
            "                <th class=\"text-right\">保质期：</th>\n" +
            "                <td>" + sdata.warranty + "</td>\n" +
            "                <th class=\"text-right\">替代品名称：</th>\n" +
            "                <td>" + sdata.twinname + "</td>\n" +
            "            </tr>\n" +
            "            <tr>\n" +
            "                <th class=\"text-right\">替代品编号：</th>\n" +
            "                <td>" + sdata.twinid + "</td>\n" +
            "                <th class=\"text-right\">生命周期(年)：</th>\n" +
            "                <td>" + sdata.lifecycle + "</td>\n" +
            "            </tr>\n" +
            "            <tr>\n" +
            "                <th class=\"text-right\">单位：</th>\n" +
            "                <td>" + sdata.amountunit + "</td>\n" +
            "                <th class=\"text-right\"></th>\n" +
            "                <td></td>\n" +
            "            </tr>\n" +
            "            <tr>\n" +
            "                <th class=\"text-right\">档案附件:</th>\n" +
            "                <td colspan=\"3\" class=\"text-left\"></td>\n" +
            "            </tr>\n" +
            "            <tr>\n" +
            "                <th class=\"text-right\">供应商集合：</th>\n" +
            "                <td>" + sdata.providergroup + "</td>\n" +
            "                <th class=\"text-right\">产品描述：</th>\n" +
            "                <td>" + sdata.productdescribe + "</td>\n" +
            "            </tr>\n" +
            "            <tr>\n" +
            "                <th class=\"text-right\">产品经理：</th>\n" +
            "                <td>" + sdata.responsibleperson + "</td>\n" +
            "                <th class=\"text-right\">登记人：</th>\n" +
            "                <td>" + sdata.register + "</td>\n" +
            "            </tr>\n" +
            "            <tr>\n" +
            "                <th class=\"text-right\">复核人：</th>\n" +
            "                <td>" + sdata.checker + "</td>\n" +
            "                <th class=\"text-right\">复核时间：</th>\n" +
            "                <td>" + sdata.checktime + "</td>\n" +
            "            </tr>";
        $("#table").html(str);
    })

}

function fh() {
    localStorage.removeItem("WZYDfileID");
    location.href = "../../wen_zhi_yi/mManufactureAdd.html";
}